//
//  LableOfB.m
//  03-UIResponder-封装button
//
//  Created by 王道林 on 16/7/18.
//  Copyright © 2016年 王道林. All rights reserved.
//

#import "LableOfB.h"

@implementation LableOfB

- (instancetype)initWithFrame:(CGRect)frame name:(NSString *)name target:(id)target action:(SEL)action
{
   self = [super initWithFrame:frame];
    if (self) {
        [self createFunctionWithName:name target:target action:action];
    }
    return self;
}

- (void)createFunctionWithName:(NSString *)name target:(id)target action:(SEL)action
{
    self.userInteractionEnabled = YES;
    self.text = name;
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:target action:action];
    [self addGestureRecognizer:tap];
}





@end
